package deom1;

import java.util.ArrayList;
import java.util.List;

public class PlayCard {
    public static void main(String[] args) {
        MyCardGame myCardGame = new MyCardGame();
        System.out.println("新的扑克牌：");
        List<MyCard> list = myCardGame.createCard();
        System.out.println(list);

        System.out.println("洗牌：");
        myCardGame.shuffleCard(list);
        System.out.println(list);

        /*
        * 现有 5 个人，每人抽 6 张牌比大小
        * */
        List<List<MyCard>> peoples = new ArrayList<>();
        peoples.add(new ArrayList<>());
        peoples.add(new ArrayList<>());
        peoples.add(new ArrayList<>());
        peoples.add(new ArrayList<>());
        peoples.add(new ArrayList<>());
        peoples.add(new ArrayList<>());

        for (int i = 0; i < 5; i++) {  // 5人
            for (int j = 0; j < 6; j++) {  //抽 6 张牌
                peoples.get(i).add(list.remove(0));
            }
        }

        System.out.println("第一个人的牌：");
        System.out.println(peoples.get(0));
        System.out.println("第二个人的牌：");
        System.out.println(peoples.get(1));
        System.out.println("第三个人的牌：");
        System.out.println(peoples.get(2));
        System.out.println("第四个人的牌：");
        System.out.println(peoples.get(3));
        System.out.println("第五个人的牌：");
        System.out.println(peoples.get(4));

    }
}
